<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>异常处理</title>
</head>
<body>
    <script>
        
        const a = 1    
        // console.log(x)
        let y = 1/1
        if(true){
            z = 1
        }
        const exp = 'consol.log("haha")'
        let str = ['a','b']
        // if(typeof str=='string'){
        //     console.log(str)
        // }else{
        //     throw Error('str遍历不是一个字符串')
        // }
        
        try{
            console.log(y1)
        }catch(e){
            console.log('变量kkk不存在')
            console.log(e.message)
            
        }finally{
            console.log('运行finally语句')
        }
        let b = connnection
        

    </script>
</body>
</html>